package com.zhangyu.shadow.repair.delegate.login;


import com.zhangyu.shadow.repair.base.IStringDataConvert;
import com.zhangyu.shadow.repair.delegate.bean.LoginBean;

import io.reactivex.disposables.Disposable;
import st.lib.base.delegate.mvp.BaseModel;
import st.lib.base.delegate.mvp.BasePresenter;
import st.lib.base.delegate.mvp.BaseView;
import st.lib.base.net.callback.IError;

/**
 * Description:
 *
 * @author Hequn.Lee
 * @date 2018/11/5
 */
public interface LoginContract {

    interface View extends BaseView {
        void loginSuccess();

        void loginFailed(int code, String msg);
    }

    interface Model extends BaseModel {
        Disposable provideLoginData(String account,
                                    String password,
                                    String appId,
                                    IStringDataConvert<LoginBean> success,
                                    IError error);
    }

    abstract class Presenter extends BasePresenter {
        /**
         * 登录
         *
         * @param account  用户名
         * @param password 密码
         * @param appId    AppId
         */
        abstract void login(String account,
                            String password,
                            String appId);

    }
}
